-
Notifications
You must be signed in to change notification settings - Fork 42
feat: implement command -p
#402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR implements the command –p functionality, rebasing against recent changes and moving platform‐specific code under the sys module. Key changes include:
- Updating command behavior to support the –p flag by modifying both the builtins and command execution logic.
- Adjusting the shell’s PATH resolution and default executable search paths.
- Adding new compatibility tests and updating platform-specific filesystem utilities.
Reviewed Changes
| File | Description |
|---|---|
| brush-core/src/builtins/command.rs | Modified command lookup and execution to support use_default_path; updated try_find_command signature. |
| brush-core/src/shell.rs | Updated PATH initialization and refactored executable search functions to use default paths. |
| brush-core/src/sys/unix/fs.rs | Added constants and functions for executable and standard utils path retrieval, including confstr integration. |
| brush-shell/tests/cases/builtins/command.yaml | Added new test cases for command -p functionality and command -v -p usage. |
| brush-core/src/commands.rs | Modified command execution to accept an optional path_dirs parameter for enhanced external command lookup. |
| brush-core/src/sys/stubs/fs.rs | Stub implementations updated for default path functions. |
| brush-core/src/interp.rs | Adapted function calls to new execute signature with path_dirs parameter. |
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Test Results 2 files 9 suites 1m 35s ⏱️ Results for commit f7891b2. ♻️ This comment has been updated with latest results. |
Performance Benchmark Report
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is Test Summary: bash-completion test suite
|
Adjusts previous changes to address earlier PR feedback; adds tests.
62bd2e7 to
f7891b2
Compare
Rebases #200 against latest changes in tree + adapts to move platform-specific code under
sys. Also adds a couple of basic compat tests to cover the functionality.Huge credit to @39555 for sorting out the problem and getting this working! I've created this under a separate PR to avoid stomping on the previous branch.